package com.demo2;import org.springframework.beans.factory.BeanNameAware;import org.springframework.stereotype.Component;import javax.annotation.PostConstruct;import javax.annotation.PreDestroy;@Componentpublic class BeanLifeComponent implements BeanNameAware {    @Override    public void setBeanName(String name) {        System.out.println("setBeanName(String name),name : " + name);    }    @PostConstruct    public void postConstruct()    {        System.out.println("BeanLifeComponent 对象初始化");    }    @PreDestroy    public void preDestroy()    {        System.out.println("BeanLifeComponent 销毁");    }    public void init()    {        System.out.println("init() 执行");    }}